<template>
  <div style="width:300px">
    <a-upload-dragger name="file" :multiple="true" action="http://127.0.0.1:8080/api/user/update_avatar?account=12345"
      @change="handleChange" >
      <p class="ant-upload-drag-icon">
        <a-icon type="inbox" />
      </p>
      <p class="ant-upload-text">
        点击或拖拽文件上传
      </p>
      <p class="ant-upload-hint">
        上传文件为zip格式，并且大小不超过2GB
      </p>
    </a-upload-dragger>
  </div>
</template>

<script>
export default {
  name: 'upload',
  data () {
    return {};
  },
  methods: {
    handleChange (info) {
      const status = info.file.status;
      if (status !== 'uploading') {
        console.log(info.file, info.fileList);
      }
      if (status === 'done') {
        this.$message.success(`上传文件成功`);
      } else if (status === 'error') {
        this.$message.error(`上传文件失败`);
      }
    },
  },
}
</script>

<style>
</style>